package org.aileen.springioc.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class SpringIocApplication {

	public static void main(String[] args) {
//		//获取注解存储对象的步骤
//		//①获取存储对象的容器->应用程序上下文
		ApplicationContext context = SpringApplication.run(SpringIocApplication.class, args);
//		//获取controller注解存储的Spring对象bean
//		UserController bean = context.getBean(UserController.class);//②获取容器中存储的对象
//		System.out.println(bean);
//		bean.sayHi();
		//---------------------------------------------
//		//获取service注解存储的Spring对象bean
//		UserService userService = context.getBean(UserService.class);
//		userService.sayHi();
		//---------------------------------------------

	}
}
